var S = {
    "0": 3823494553,
    "1": 1699002000,
    "2": 1699000000 + parseInt(Math.random() * 10000),
    "3": 4183819009,
    "4": 1,
    "5": 10,
    "6": 5,
    "7": 68,
    "8": 1,
    "9": 0,
    "10": 37,
    "11": 669,
    "12": 242,
    "13": 3748,
    "14": 0,
    "15": 0,
    "16": 46,
    "17": 3,
    "base_fileds": [
        4,
        4,
        4,
        4,
        1,
        1,
        1,
        3,
        2,
        2,
        2,
        2,
        2,
        2,
        2,
        4,
        2,
        1
    ],
    toBuffer :function() {
                for (var a = "base_f", u = this["base_fileds"], c = [], s = -1, v = 0, f = u.length; v < f; v++)
                    for (var l = this[v], p = u[v], d = s += p; c[d] = l & parseInt("255", 10),
                    --p != 0; )
                        --d,
                        l >>= parseInt("10", 8);
                return c
            }
},m = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
function timeNow() {
                var n = new Date;
                try {
                    return time = Date.now(),
                    time / parseInt('1111101000', 2) >>> 0
                } catch (t) {
                    return time = n.getTime(),
                    time / parseInt('1000', 10) >>> 0
                }
            }
function et() {
                var n = ot(o[243])
                  , e = o[244];
                _ = location[c[140]].split(o[233])[i[2]],
                E = location[n + Tn + e],
                T = location[i[245]],
                B = location[ot(t[211])],
                A = Jn.getRootDomain(E),
                R = new o[27](i[246] + A.replace(new r[47](t[212],i[96]), ot(c[247], r[213])) + t[214],r[116]),
                M(),
                Y(),
                N(),
                $(),
                D()
            }
function D(n) {
    var t = O(n);
    if (rn,
    p,
    t[r[52]] != h)
        return error = T + B + l,
        void 0;
    var a = t[c[0]]
      , o = [];
    return g(t, +parseInt(e[79], c[122]), o, +u[2], a),
    x(o) == a ? o : void 0
}
function x(n) {
    var t = "3";
    t = 0;
    for (var e = 0, i = 0, u = n["length"]; i < u; i++)
        e = (e << 5) - e + n[i];
    return e & parseInt("11111111", 2)
}
function w(n) {
                for (var t = "0", i = 0, v = n["length"], f = []; i < v; ) {
                    var l = n[i++] << parseInt("1" + t, 16) | n[i++] << 8 | n[i++];
                    f.push(m.charAt(l >> parseInt("22", 8)), m.charAt(l >> parseInt("12", 10) & parseInt("111111", 2)), m.charAt(l >> 6 & parseInt("63", 10)), m.charAt(l & parseInt("3f", 16)))
                }
                return f.join("")
            }
function g(n, a, o, i, u) {
                for (var c = "11", v = "11", f = n["length"]; a < f; )
                    o[i++] = n[a++] ^ u & parseInt(c + v + "11" + "11", 2),
                    u = ~(u * parseInt("203", 8))
            }
function N(n) {
    var t = et
      , r = x(n)
      , e = [3, r];
    return g(n, 0, e, 2, r),
    t = "co",
    w(e)
}
function O() {
    var R = 16;
    S[R]++,
    S[1] = parseInt(1698491425.514),
    S[2] = timeNow(),
    S[15] = 0,
    S[7] = 0,
    S[8] = 3,
    S[9] = 737,
    S[10] = 38,
    S[11] = 700,
    S[12] = 33;
    var n = S.toBuffer();
    return N(n)
}

function getRandomStr(charArr) {
    var length = 10;
    var str = "";
    var backArr = [];
    var arr = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
    var i;
    var num;
    length = (typeof length === "number" && length > 0) ? length : 0;
    if (charArr instanceof Array && charArr.length > 0) {
        arr = charArr
    }
    var len = arr.length;
    for (i = 0; i < length; i++) {
        num = Math.floor(Math.random() * len);
        backArr.push(arr[num])
    }
    str = backArr.join("");
    return str
}
function setCookie() {
    var name = 'ta_random_userid',value = getRandomStr();
    var expiresTimes = 10 * 12 * 30 * 24 * 60 * 60 * 1000;
    var expiresDate = new Date();
    var expiresTimestamp = expiresDate.getTime() + expiresTimes;
    expiresDate.setTime(expiresTimestamp);
    cookiec = '' + name + '=' + value + ';expires=' + expiresDate.toGMTString() + ';path=/';
    return cookiec
}
console.log(getRandomStr())